package com.own.business.wallet.mapper;

import com.own.business.wallet.entity.map.WalletMapVo;
import com.own.business.wallet.entity.po.Wallet;
import com.own.business.wallet.entity.query.WalletQuery;
import com.own.business.wallet.entity.vo.WalletVo;
import com.own.component.common.base.mapper.BasePageMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * WalletMapper
 *
 * @author chenxueli
 * @date 2023-07-13 16:07:39
 */
@Mapper
public interface WalletMapper extends BasePageMapper<
        Wallet,
        WalletVo,
        WalletMapVo,
        WalletQuery
        > {

    /**
     * 增加余额
     *
     * @param id      钱包id
     * @param balance 余额
     * @return 影响行数
     */
    int increase(@Param("id") Long id, @Param("balance") Integer balance);

    /**
     * 减少余额
     *
     * @param id      钱包id
     * @param balance 余额
     * @return 影响行数
     */
    int decrease(@Param("id") Long id, @Param("balance") Integer balance);

    /**
     * 修改钱包密码
     *
     * @param id       钱包id
     * @param password 密码
     * @return 影响行数
     */
    int updatePassword(@Param("id") Long id, @Param("password") String password);

}
